#include<stdio.h>
int main(void)
{
	int num=0,ge=0,shi=0,bai=0,qian=0;
	scanf("%d",&num);
	if(num>999)
	{
		qian=num/1000;
		bai=num/100%10;
		shi=num/10%10;
		ge=num%10;
		printf("%d",qian+bai*10+shi*100+ge*1000);
	}
	if(num>99&&num<1000)
	{
		bai=num/100;
		shi=num/10%10;
		ge=num%10;
		printf("%d",bai+shi*10+ge*100);
	}
	return 0;
}
